<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Rep\ManagementCardRep;
use Illuminate\Http\Request;

class ManagementCard extends Controller
{
    //小票机管理卡管理
    protected $rep;

    public function __construct(Request $request)
    {
        $this->rep = new ManagementCardRep();
    }

    /**
     * 获取列表
     * @param Request $request
     */
    public function getManagementCardList(Request $request){
        $params = $request->all();
        $data = $this->rep->getManagementCardListRep($params);
        return re(0,$data,'success');
    }

    /**
     * 添加
     * @param Request $request
     */
    public function createManagementCard(Request $request){
        $params = $request->all();
        $data = $this->rep->createManagementCardRep($params);
        return re($data['code'],$data['data']);
    }

    /**
     * 删除
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     */
    public function delManagementCard(Request $request){
        $params = $request->all();
        $data = $this->rep->delManagementCardRep($params);
        return re($data['code'],$data['data']);
    }

}
